<!--
 * @Author: cqg
 * @Date: 2020-11-17 20:05:08
 * @LastEditors: cqg
 * @LastEditTime: 2021-06-09 10:48:18
 * @Description: file content
-->
<template>
  <basic-container>
    <dataList ref="dataList" placeholder="请输入承租方或物业名称" :pageInfo="pager" :listData="tableData" searchName="propertyNames" :menuList="[{ add: '合同录入' }, 'export']" :filterList="filterList" @menu-click="handleMenuClick">
      <el-table :data="tableData" align="left">
        <el-table-column label="物业名称" prop="propertyNames" width="200" show-overflow-tooltip />
        <el-table-column label="合同编码" prop="contractCode" width="200" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ scope.row.contractCode}}
            <img :src="NewIcon" class="imgIcon" v-if="scope.row.status == '01'" />
          </template>
        </el-table-column>
        <el-table-column label="承租方" prop="customerName" width="200" show-overflow-tooltip />
        <el-table-column prop="status" label="合同状态" width="120">
          <template slot-scope="scope">{{scope.row.status | dict("rent_contract_status")}}</template>
        </el-table-column>
        <el-table-column label="合同签订日期" prop="signDate" width="120" />
        <el-table-column width="200" label="租赁周期" prop="startTime">
          <template slot-scope="scope">{{ scope.row.startDate }}至{{scope.row.endDate}}</template>
        </el-table-column>
        <el-table-column width="220" label="操作" fixed="right">
          <template slot-scope="scope">
            <el-button type="text" @click="view(scope.row)">查看</el-button>
            <el-button type="text" @click="edit(scope.row)" v-if="['00', '02','01', '12', '14'].includes(scope.row.status)">编辑</el-button>
            <el-button type="text" @click="del(scope.row)" v-if="['00', '01'].includes(scope.row.status)">删除</el-button>
            <el-button type="text" @click="change(scope.row)" v-if="['03'].includes(scope.row.status)">变更</el-button>
            <el-button type="text" @click="renew(scope.row)" v-if="['03',  '04'].includes(scope.row.status)">续签</el-button>
            <el-button type="text" @click="back(scope.row)" v-if="['03'].includes(scope.row.status)">退租</el-button>
            <el-button type="text" @click="send(scope.row)" v-if="scope.row.status == '01'">提交</el-button>
            <el-button type="text" @click="excute(scope.row)" v-if="scope.row.status == '13'">执行</el-button>
          </template>
        </el-table-column>
      </el-table>
    </dataList>
    <type-select ref="typeSelect1" />
    <contract-back ref="contractBack" @resetList="resetList"/>
    <contract-view ref="contractView" />
  </basic-container>
</template>
<script src="./list.js"></script>
<style scoped lang="scss">
@import "./list";
</style>
